﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusLoaiTien

    Private LoaiTienDAO As New SqlServerLoaiTien
    Private oTable As New DataTable

    Public Function GetAllLoaiTien(ByVal sStringConnection As String) As Object
        Try
            oTable = LoaiTienDAO.GetAllLoaiTien(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertLoaiTien(ByVal sStringConnection As String, ByVal oLoaiTien As LoaiTien)
        Try
            LoaiTienDAO.InsertLoaiTien(sStringConnection, oLoaiTien)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateLoaiTien(ByVal sStringConnection As String, ByVal oLoaiTien As LoaiTien)
        Dim bool_ As Boolean = True
        Try
            LoaiTienDAO.UpdateLoaiTien(sStringConnection, oLoaiTien)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteLoaiTien(ByVal sStringConnection As String, ByVal oLoaiTien As LoaiTien)
        Try
            LoaiTienDAO.DeleteLoaiTien(sStringConnection, oLoaiTien.SoLoaiTien)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

End Class
